<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 100px;
                text-align: right;
            }

            .col-input {
                width: 30px;
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }

            function doPopupWindow(obj) {
                var tablename = obj.parentNode.parentNode.childNodes[0].innerHTML;
                popupwindow = window.open("deleteLogDetl.xhtml?action=delete&amp;tablename=" + tablename, "popupwindow", "height=300,width=800,left=300,top=200,toolbar=no,menubar=no,scrollbars=yes,location=no");
                popupwindow.focus;
            }
        </script>

    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="query">
                <p:growl id="msgs" showDetail="false"/>
                <p:panel header="系统任务调度详情">
                    <br/>
                    <p:fieldset legend="系统任务调度管理详情" toggleable="true">
                        <br/>
                        <p:ajaxStatus style="height:20px;text-align:center">
                        <f:facet name="start">
                            <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                        </f:facet>
                        <f:facet name="complete">
                            <h:outputText value=""/>
                        </f:facet>
                    </p:ajaxStatus>
                        <p:menubar>

                            <p:menuitem type="push" value="启动所选项" icon="ui-icon ui-icon-extlink"
                                        action="#{quartzMngAction.resumeRecords}" update="msgs,pdt" ajax="true"/>
                            <p:menuitem type="push" value="暂停所选项" icon="ui-icon ui-icon-newwin"
                                        action="#{quartzMngAction.pauseRecords}" update="msgs,pdt" ajax="true"/>
                            <p:menuitem type="push" value="删除所选项" icon="ui-icon ui-icon-close"
                                        action="#{quartzMngAction.deleteRecords}" update="msgs,pdt" ajax="true"/>
                        </p:menubar>
                        <p:dataTable id="pdt" style="width:100%;"
                                     dynamic="true" selection="#{quartzMngAction.selectedRecords}"
                                     value="#{quartzMngAction.qrtzTrigerJobs}" var="record"
                                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     paginator="true" rows="5" paginatorPosition="bottom"
                                     rowsPerPageTemplate="100,50,30,10,5"
                                     emptyMessage="数据记录为空...">
                            <p:column selectionMode="multiple"/>
                            <p:column headerText="触发器组名" style="text-align:left">
                                <h:outputText value="#{record.trigGroup}"/>
                            </p:column>
                            <p:column headerText="触发器名" style="text-align:left">
                                <h:outputText value="#{record.trigName}"/>
                            </p:column>
                            <p:column headerText="作业名" style="text-align:right">
                                <h:outputText value="#{record.jobName}"/>
                            </p:column>
                            <p:column headerText="作业类名" style="text-align:center">
                                <h:outputText value="#{record.jobClassName}"/>
                            </p:column>

                            <p:column headerText="作业描述" style="text-align:center">
                                <h:outputText value="#{record.jobDescription}"/>
                            </p:column>
                            <p:column headerText="上次执行时间" style="text-align:center">
                                <h:outputText value="#{record.prevFireTime}"/>
                            </p:column>
                            <p:column headerText="下次执行时间" style="text-align:center">
                                <h:outputText value="#{record.nextFireTime}"/>
                            </p:column>
                            <p:column headerText="触发器状态" style="text-align:center">
                                <h:outputText value="#{quartzMngAction.jobStatus.valueOfAlias(record.trigState).title}"/>
                            </p:column>

                        </p:dataTable>

                    </p:fieldset>
                </p:panel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>